package com.zxy.model;

import com.zxy.enums.VendorStatus;
import lombok.Data;

@Data

public class Vendor extends BaseModel{
    private Integer id;

    private String name;

    private Integer status;
    private String province;
    private String city;
    private String county;
    private String address;
    private String tel;
    private String img;
    private String brief;
    private Integer seq;


    private String StatusX;
    public String getStatusX() {
//        先拿 VendorStatus 里面的一个静态方法 findByCode
//        如果不为空，直接返回getMsg,为空，则返回空
        VendorStatus vendorStatus = VendorStatus.findByCode(this.getStatus());
        if(vendorStatus != null){
            return vendorStatus.getMsg();
        }
        return "";
//这时候我们的接口就会多一个statusX

//        return statusX;
    }


}
